﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage/MasterPage.master" AutoEventWireup="true" CodeFile="UserManagement.aspx.cs" Inherits="Pages_UserManagement" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">
        .style1
        {
            width: 51%;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:Panel ID="pnlSignUpInformation" runat="server" BorderStyle="Solid" BorderWidth="1px">
        <div style="width:100%">
            <table width="100%">
                <tr>
                    <td valign="top" class="style1">
                        <asp:Panel ID="pnlSignUpforNewAccount" runat="server" Width="100%" Enabled="true"
                            GroupingText="Sign Up for New Account">
                            <table>
                                <tr>
                                    <td align="right">
                                        <asp:Label ID="lblUserName" runat="server" Text="User Name:"></asp:Label>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtUserName" runat="server"></asp:TextBox>
                                    </td>
                                    
                                </tr>
                                <tr>
                                    <td align="right">
                                        <asp:Label ID="lblPassword" runat="server" Text="Password:"></asp:Label>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtPassword" runat="server" TextMode="Password"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="right">
                                        <asp:Label ID="lblConfirmPassword" runat="server" Text="Confirm Password:"></asp:Label>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtConfirmPassword" runat="server" TextMode="Password"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="right">
                                        <asp:Label ID="lblEmail" runat="server" Text="Email:"></asp:Label>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtEmail" runat="server"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="right">
                                        <asp:Label ID="lblIsApproved" runat="server" Text="Is Active:"></asp:Label>
                                    </td>
                                    <td>
                                        <asp:CheckBox ID="chkActiveInactive" runat="server" />
                                    </td>
                                </tr>
                                <tr>
                                    <td align="center" colspan="2">
                                        <asp:CompareValidator ID="PasswordCompare" runat="server" ControlToCompare="txtPassword"
                                            ControlToValidate="txtConfirmPassword" Display="Dynamic" ErrorMessage="The Password and Confirmation Password must match."
                                            ValidationGroup="CreateUserWizard1"></asp:CompareValidator>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="2">
                                        <asp:Label ID="lblMessage" runat="server" Text=""></asp:Label>
                                    </td>
                                </tr>
                            </table>
                        </asp:Panel>
                    </td>
                    <td width="60%" valign="top">
                        <asp:Panel ID="pnlRoleContainer" runat="server" GroupingText="Select Role For this User"
                            Width="100%" Height="100%">
                            <asp:Panel ID="pnlRole" runat="server" Width="100%" Height="138px" BorderWidth="0"
                                ScrollBars="Auto">
                                <asp:CheckBoxList ID="chkBLRoles" runat="server" RepeatColumns="3" Width="100%">
                                </asp:CheckBoxList>
                            </asp:Panel>
                        </asp:Panel>
                    </td>
                </tr>
            </table>
        </div>
        <div>
            <table>
            </table>
        </div>
        <div align="right">
            <table width="30%">
                <tr>
                    <td width="15%">
                        <asp:Button ID="btnCreateUser" runat="server" Text="Create User" Width="100%" OnClick="btnCreateUser_Click" />
                    </td>
                    <td width="15%">
                        <asp:Button ID="btnCancel" runat="server" Text="Cancel" Width="100%" OnClick="btnCancel_Click" />
                    </td>
                </tr>
            </table>
        </div>
    </asp:Panel>
    <div>
        &nbsp</div>
    <asp:Panel ID="pnlUser" runat="server" BorderStyle="Solid" BorderWidth="1px">
        <div style="display: none;">
            <table width="100%">
                <tr>
                    <td>
                        <asp:Panel ID="pnlSearch" runat="server" GroupingText="Search">
                        </asp:Panel>
                    </td>
                </tr>
            </table>
        </div>
        <div>
            <table width="100%">
                <tr>
                    <td>
                        <asp:GridView ID="grdUsers" runat="server" Width="100%" DataKeyNames="ProviderUserKey"
                            AutoGenerateColumns="false" BorderColor="#336699" BorderStyle="Solid" BorderWidth="2px"
                            ForeColor="#333333" CellPadding="4" HorizontalAlign="Center" >
                            <Columns>
                                <asp:BoundField HeaderText="#" ItemStyle-Width="3%" ItemStyle-HorizontalAlign="Center" />
                                <%--<asp:TemplateField ItemStyle-Width="7%" ItemStyle-HorizontalAlign="Center" HeaderText="#">
                                    <ItemTemplate>
                                         <asp:Label ID="lblSR" runat="server"></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>--%>
                                <asp:TemplateField Visible="false" HeaderText="User Id">
                                    <ItemTemplate>
                                        <asp:Label ID="lblUserId" runat="server" Text='<%# Bind("ProviderUserKey") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField ItemStyle-Width="7%" ItemStyle-HorizontalAlign="Center">
                                    <ItemTemplate>
                                        <asp:LinkButton ID="LnkEdit" runat="server" CommandArgument='<%# Eval("UserName") %>'
                                            CommandName="Edit" Text="Edit" ForeColor="Blue" />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField ItemStyle-Width="8%" Visible="false" ItemStyle-HorizontalAlign="Center">
                                    <ItemTemplate>
                                        <asp:LinkButton ID="LnkDelete" runat="server" CommandArgument='<%# Eval("UserName") %>'
                                            CommandName="Delete" OnClientClick='return confirm("Are you sure you want to delete this entry?");'
                                            Text="Delete" ForeColor="Blue" />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField ItemStyle-Width="15%" HeaderText="User Name">
                                    <ItemTemplate>
                                        <asp:Label ID="lblUserName" runat="server" Text='<%# Bind("UserName") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField ItemStyle-Width="7%" HeaderText="Active" ItemStyle-HorizontalAlign="Center">
                                    <ItemTemplate>
                                        <asp:CheckBox ID="chkIsApproved" runat="server" HorizontalAlignment="Center" Checked='<%# Bind("IsApproved") %>'
                                            Enabled="false"></asp:CheckBox>
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                        </asp:GridView>
                    </td>
                </tr>
            </table>
        </div>
    </asp:Panel>
</asp:Content>

